import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  queryAll = '/ZkPv/zkPv/queryAllPC',
  queryAll2 = '/ZkPv/zkPv/queryAllPCH',
  queryCount='/ZkPv/zkPv/queryCountPC',
  queryCount2='/ZkPv/zkPv/queryCountPCH',
  queryEqPC='/ZkPv/zkPv/queryEqPC',
  queryEqPC2='/ZkPv/zkPv/queryEqPCH',
  queryMessage='/zkClassMessage/zkClassMessage/queryZkClassMessagePC'
}
/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;
/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;
/**
 * PC查询近30天每天各缺陷类数量的叠层
 * @param params
 */
export const queryAll = (params) =>
  defHttp.post({url: Api.queryAll, params});
/**
 * PC合查询近30天每天各缺陷类数量的叠层
 * @param params
 */

export const queryAll2 = (params) =>
  defHttp.post({url: Api.queryAll2, params});
/**
 * PC查询24小时所有缺陷数量的总和)
 * @param params
 */

export const queryCount = (params) =>
  defHttp.post({url: Api.queryCount, params});
/**
 * PC查询24小时所有缺陷数量的总和)
 * @param params
 */

export const queryCount2 = (params) =>
  defHttp.post({url: Api.queryCount2, params});
/**
 * PC端查询三个班次每个小时各缺陷类数据）
 * @param params
 */

export const queryEqPC = (params) =>
  defHttp.post({url: Api.queryEqPC, params});

/**
 * PC端查询三个班次每个小时各缺陷类数据）
 * @param params
 */
export const queryEqPC2 = (params) =>
  defHttp.post({url: Api.queryEqPC2, params});

/**
 * 班次信息查询（PC端）
 * @param params
 */
export const queryZkClassMessagePC = (params) =>
  defHttp.post({url: Api.queryMessage, params});

/**
 * 根据产品名称查询开始时间和结束时间
 * @param params
 */
export const queryDateTime = (params) =>
  defHttp.post({url: '/zkClassMessage/zkClassMessage/queryDataTime', params});
/**
 * 查询产品名称接口
 * @param params
 */
export const queryName = (params) =>
  defHttp.get({url: '/zkClassMessage/zkClassMessage/queryProductSpecsName', params});
/**
 * PC端查询报表
 * @param params
 */
export const queryEqReport = (params) =>
  defHttp.post({url: '/ZkPv/zkPv/queryEqReport', params});
